const cloud = require('wx-server-sdk')
cloud.init()
const db = cloud.database()
exports.main = async(event, context) => {
  try {
    await db.collection('Topic').doc(event._id).update({
      data: {
        ktmc: event.ktmc,
        ktjj: event.ktjj,
        jsyq: event.jsyq,
        ckzl: event.ckzl
      }
    })
    return {
      result: 1
    }
  } catch (e) {
    return {
      result: 0
    }
  }
}